<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label for="c-course_name" class="control-label col-xs-12 col-sm-2">课程名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_name" name="row[course_name]" type="text" class="form-control" placeholder="请输入课程名称">
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-course_cover" class="control-label col-xs-12 col-sm-2">课程封面:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-course_cover" name="row[course_cover]" type="text" class="form-control" placeholder="请选择课程封面">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-course_cover" class="btn btn-danger plupload" data-input-id="c-course_cover" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-course_cover"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-course_cover" class="btn btn-primary fachoose" data-input-id="c-course_cover" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-course_cover"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-course_cover"></ul>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-course_content" class="control-label col-xs-12 col-sm-2">课程内容:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-course_content" name="row[course_content]" class="form-control editor" rows="5" placeholder="请输入课程内容"></textarea>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-course_type" class="control-label col-xs-12 col-sm-2">课程类型:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-course_type" name="row[course_type]" class="form-control">
                <option value="">请选择课程类型</option>
                <option value="1">公益活动</option>
                <option value="2">社区活动</option>
                <option value="3">研学活动</option>
                <option value="4">趣味活动</option>
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-class_type" class="control-label col-xs-12 col-sm-2">课堂类型:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-class_type" name="row[class_type]" type="text" class="form-control" value="社区课堂" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="c-address" class="control-label col-xs-12 col-sm-2">上课地点:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" name="row[address]" class="form-control" value="{$ocation['address']}" placeholder="请输入上课地点">
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-date_restriction" class="control-label col-xs-12 col-sm-2">日期限制:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-date_restriction" name="row[date_restriction]" class="form-control" style="margin-bottom: 10px;">
                <option value="">无限制</option>
                <option value="workdays">仅工作日（周一至周五）</option>
                <option value="weekends">仅周末（周六、周日）</option>
                <option value="custom_weekdays">自定义周几</option>
                <option value="specific_dates">指定日期</option>
            </select>
        </div>
    </div>

    <div class="form-group" id="custom-weekdays-group" style="display: none;">
        <label class="control-label col-xs-12 col-sm-2">选择周几:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox-inline">
                <label><input type="checkbox" name="row[custom_weekdays][]" value="1" class="weekday-checkbox"> 周一</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="2" class="weekday-checkbox"> 周二</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="3" class="weekday-checkbox"> 周三</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="4" class="weekday-checkbox"> 周四</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="5" class="weekday-checkbox"> 周五</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="6" class="weekday-checkbox"> 周六</label>
                <label><input type="checkbox" name="row[custom_weekdays][]" value="7" class="weekday-checkbox"> 周日</label>
            </div>
        </div>
    </div>

    <div class="form-group" id="specific-dates-group" style="display: none;">
        <label for="c-specific_dates" class="control-label col-xs-12 col-sm-2">指定日期:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-specific_dates" name="row[specific_dates]" class="form-control" rows="3" placeholder="请输入允许的日期，每行一个，格式：2024-01-15"></textarea>
            <small class="help-block">每行输入一个日期，格式为：YYYY-MM-DD</small>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-course_date" class="control-label col-xs-12 col-sm-2">课程日期:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_date" name="row[date]" type="text" class="form-control restricted-datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" data-restriction-config="{}" placeholder="请选择课程日期">
            <div id="quick-date-buttons" style="margin-top: 8px; display: none;">
                <label style="font-weight: normal; margin-right: 10px;">快速选择：</label>
                <button type="button" class="btn btn-xs btn-primary quick-date-btn" data-days="7" style="margin-right: 5px;">
                    <i class="fa fa-calendar"></i> 未来7天
                </button>
                <button type="button" class="btn btn-xs btn-primary quick-date-btn" data-days="30" style="margin-right: 5px;">
                    <i class="fa fa-calendar"></i> 未来30天
                </button>
                <button type="button" class="btn btn-xs btn-primary quick-date-btn" data-days="90">
                    <i class="fa fa-calendar"></i> 未来90天
                </button>
            </div>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-course_time" class="control-label col-xs-12 col-sm-2">课程时间:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_time" name="row[start_time]" type="text" class="form-control" placeholder="如：09:00-11:00">
        </div>
    </div>

    <div class="form-group">
        <label for="c-is_yuyue" class="control-label col-xs-12 col-sm-2">是否预约:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-is_yuyue" name="row[is_yuyue]" type="checkbox" value="1">
        </div>
    </div>

    <div class="form-group">
        <label for="c-is_yuyue" class="control-label col-xs-12 col-sm-2">自定义标签:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tags" name="row[tags]" type="text" class="form-control" placeholder="请输入标签，多个标签用英文逗号隔开">
        </div>
    </div>

    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
        <div class="col-xs-12 col-sm-8" id="div-status">
            <input id="c-status" name="row[status]" type="hidden" value="1">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher active" data-input-id="c-status" data-yes="1" data-no="0">
                <i class="fa fa-toggle-on text-success fa-2x"></i>
            </a>
            <div data-favisible="switch=1" class="p-3">正常</div>
            <div data-favisible="switch=0" class="p-3">禁用</div>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>